//
//  ViewController.m
//  XXslider
//
//  Created by h92 on 14/12/15.
//  Copyright (c) 2014年 李腾飞. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController
@synthesize leftSwich;
@synthesize rightSwich;
@synthesize sliderValue;

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


#pragma mark -- 实现开关同步

- (IBAction)theSame:(id)sender {
    //强制转换
    UISwitch *swich=(UISwitch *)sender;
    BOOL setting=swich.isOn;
   
    //开关状态
    [self.leftSwich setOn:setting animated:YES];
    [self.rightSwich setOn:setting animated:YES ];
    
    
    
}

- (IBAction)valuechange:(id)sender {
    UISlider *value=(UISlider *)sender;
    int a=(int)value.value;
    sliderValue.text=[[NSString alloc]initWithFormat:@"%i",a ];
    
    
}

- (IBAction)touchDown:(id)sender {
    if (leftSwich.hidden==YES) {
        leftSwich.hidden=NO;
        rightSwich.hidden=NO;
    }else
    {
        leftSwich.hidden=YES;
        rightSwich.hidden=YES;
    }
}


@end

















